package cn.itsource.bean;

import cn.itsource.tree.BaseTreeNode;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

/**
 * @author : 张金铭
 * @description :
 * @create :2022-11-07 11:49:00
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("t_department")
@ApiModel("员工实体类")
public class Department extends BaseTreeNode<Department> implements Serializable {
    @ApiModelProperty("员工id")
    private Long id;
    @ApiModelProperty("部门编号")
    @Size(min = 2, max = 10,message = "部门编号长度需要在2-10之间，兄嘚别乱搞")
    private String sn;//部门编号
    @ApiModelProperty("部门名称")
    @NotBlank(message = "部门名称不能为空，兄嘚别乱搞")
    private String name;//部门名称
    @ApiModelProperty("部门状态 0  1")
    private Integer state;//部门状态 0  1
    @ApiModelProperty("部门管理员id")
    private Long managerId;//部门管理员id
    @ApiModelProperty("上级部门")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long parentId;//上级部门
    @ApiModelProperty("部门级联路径")
    private String dirPath;//部门级联路径


    @TableField(exist = false)
    private String userName="";//领导名字

    @TableField(exist = false)
    private String parentName="";//上级部门名字

    @TableField(exist = false)
    private List<Long> parentInts;//存储的部门层级




}
